import { ApiReturn } from '@/types/global';
import { get, post } from '@/utils/request';
import {
  ListReq,
  ListResp,
  CreateReq,
  CreateResp,
  DeleteReq,
  GetReq,
  GetResp,
  UpdateReq,
  UpdateResp,
  ListPodReq,
  ListPodResp
} from '../vms';

class DeployService {
  static list = (params: ListReq): ApiReturn<ListResp> =>
    get('/v1/deploy/list', params);

  static create = (data: CreateReq): ApiReturn<CreateResp> =>
    post('/v1/deploy/create', data);

  static delete = (params: DeleteReq): ApiReturn<{}> =>
    get('/v1/deploy/delete', params);

  static get = (params: GetReq): ApiReturn<GetResp> =>
    get('/v1/deploy/get', params);

  static update = (data: UpdateReq): ApiReturn<UpdateResp> =>
    post('/v1/deploy/update', data);

  static listPod = (params: ListPodReq): ApiReturn<ListPodResp> =>
    get('/v1/pod/list', params);
}

export { DeployService };
export default DeployService;
